Avoid accidental Java 9+ dependency with --release #10441
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In d654707 we swapped compiling the uploaded artifacts to Java 11. This caused ABI issues with ByteBuffer, like clear() returning ByteBuffer instead of Buffer.
There are source-level approaches to avoid the accidental ABI dependency on Java 11, but we have no tool able to detect such breakages. We use Animalsniffer for similar cases, but it fails to detect these[1]. Since we have no tool, source-level approaches can't gain the necessary confidence that all incompatibility fixes have been resolved.
Java has had javac-level ways to address this, but they used to require setting bootclasspath. Since Java 9, though, they made it easier and we can use --release, which does exactly what we need.
Fixes #10432